﻿using System;
using System.Windows.Forms;
using LPTask.Interfaces.Views;

namespace LPTask.UI
{
    internal class UserMessageView : IUserMessageView
    {
        public void ShowError(string message)
        {
            MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public void ShowError(Exception ex)
        {
            ShowError(ex.Message);
        }

        public void ShowWarning(string message)
        {
            MessageBox.Show(message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }

        public void ShowInfo(string message)
        {
            MessageBox.Show(message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        public bool ShowQuestion(string message)
        {
            DialogResult result = MessageBox.Show(message, "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            return result == DialogResult.OK;
        }
    }
}